<?php
/*
 * Created on Sep 12, 2007
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
function getID($postID, $getID) 
{
 	if($postID != "") {
		$id = $postID; 
	} elseif($getID != "") {
		$id = $getID;	
	} else {
		die("No ID");
	}
	return $id;
}

//Takes an ID from post data and returns true if its a boolean 
//or false if it is anything else
function isBoolean($id) 
{
	$booleans = array("isPrimary" => true, "LetterWidth" => true, "LetterHeight" => true);
	if($booleans[$id])
		return true;
	return false;
}
//Takes a name from a query.  If it is in the array below this function returns that name instead
//If it is not in the list it returns the original name.
function shiftName($name) {
	$names=array("LetterHeight" => "Letters in Rows", "LetterWidth" => "Letters in Columns", 
"isPrimary" =>"Is Primary Cell", "numRows" => "Number of Rows", "numCols" => "Number of Columns");
	if(isset($names[$name])) {
		return $names[$name];
	}
	return $name;
}
?>
